package com.sitc.street_lab_2013;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

public class HelpActivityTwo extends Activity {
	
	private final static String hTitle = "Scanning QR Code";
	private final static String hDesc = "Scan the QR Code with your phone until you are prompted to answer the question.";
	private final static int hImage = R.drawable.help_qrcode;
	private final static String hButton1 = "Back";
	private final static boolean hButton1Enabled = true;
	private final static String hButton2 = "Next";
	private final static boolean hButton2Enabled = true;
	
	private TextView title, description;
	private Button one, two;
	private ImageView image;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);

	    setContentView(R.layout.activity_help);
	    setTitle("Tutorial");
	    setViews();
	}

	private void setViews() {

		title = (TextView) findViewById(R.id.help_title);
		title.setText(hTitle);
		
		description = (TextView) findViewById(R.id.help_desc);
		description.setText(hDesc);
		
		one = (Button) findViewById(R.id.help_button1);
		one.setText(hButton1);
		one.setEnabled(hButton1Enabled);
		one.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

				Intent backIntent = new Intent(HelpActivityTwo.this,HelpActivity.class);
				HelpActivityTwo.this.startActivity(backIntent);
				HelpActivityTwo.this.finish();
				
			}
			
		});
		
		two = (Button) findViewById(R.id.help_button2);
		two.setText(hButton2);
		two.setEnabled(hButton2Enabled);
		two.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				
				Intent nextIntent = new Intent(HelpActivityTwo.this,HelpActivityThree.class);
				HelpActivityTwo.this.startActivity(nextIntent);
				HelpActivityTwo.this.finish();
				
			}
		});
		
		image = (ImageView) findViewById(R.id.help_image);
		image.setImageDrawable(getResources().getDrawable(hImage));
	}

}
